﻿#include "MaterialFoamsWapper.h"
#include "FITK_Kernel/FITKAppFramework/FITKMessage.h"

Foams * MaterialFoamsWapper::new_Foams()
{
    return new Foams;
}
void MaterialFoamsWapper::delete_Foams(Foams * obj)
{
    if (obj) delete obj;
}

Foams * MaterialFoamsWapper::static_Foams_GetFoams(const QString & name)
{
    return new Foams(name);
}

QString MaterialFoamsWapper::getName(Foams * obj)
{
    if (obj)
        return obj->getName();
    return QString();
}

void MaterialFoamsWapper::setName(Foams * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->setName(name);
    if (!ok) {
        AppFrame::FITKMessageError("Set Name failed !");
    }
}

void MaterialFoamsWapper::setDensity(Foams * obj, double density)
{
    if (!obj)return;
    bool ok = obj->setDensity(density);
    if (!ok) {
        AppFrame::FITKMessageError("Set Density failed !");
    }
}

void MaterialFoamsWapper::setModulus(Foams * obj, double shear, double young, double poissonRatio)
{
    if (!obj)return;
    bool ok = obj->setModulus(shear, young, poissonRatio);
    if (!ok) {
        AppFrame::FITKMessageError("Set Modulus failed !");
    }
}

void MaterialFoamsWapper::setOtherProp(Foams * obj, double flowResistivity, double porosity, double tortuosity, double viscousLength, double thermalLength, double lossFactor)
{
    if (!obj)return;
    bool ok = obj->setOtherProp(flowResistivity, porosity, tortuosity, viscousLength, thermalLength, lossFactor);
    if (!ok) {
        AppFrame::FITKMessageError("Set Other Properties failed !");
    }
}

void MaterialFoamsWapper::createMaterial(Foams * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->createMaterial(name);
    if (!ok) {
        AppFrame::FITKMessageError("Create Foam Material failed !");
    }
}

Foams::Foams(const QString & name) :
    Acoustics::PyFITKMaterialsFoams(name)
{
}

Foams::Foams() :
    Acoustics::PyFITKMaterialsFoams()
{
}
